package com.ruofeng.app.kotlin.common.dsl.`fun`

/**
 * Created by 邱鹏 on 2017/8/26.
 */
// 匿名类写法
val runnable1 = object : Runnable{
    override fun run() {
        println("I'm an anonymous class")
    }
}

// 函数写法, 略像js
val runnable2 = fun (){
    println("I'm a function")
}

// lambda写法1
val runnable3 = Runnable { ->
    println("I'm a Lambda")
}

// lambda写法2
val runnable4 = { println("I'm a Lambda") }
class KotlinMain{
    companion object{
        @JvmStatic
        fun main(args: Array<String>) {
            Thread(runnable1).start()
            Thread(runnable2).start()
            Thread(runnable3).start()
            Thread(runnable4).start()
        }
    }
}
